<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI 面试系统 - 注册</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-8 col-lg-6">
            <div class="card shadow">
                <div class="card-body">
                    <h3 class="card-title text-center mb-4">创建账户</h3>

                    <div th:if="${errorMessage}" class="alert alert-danger">
                        [[${errorMessage}]]
                    </div>

                    <form th:action="@{/register}" method="post">
                        <div class="mb-3">
                            <label for="fullName" class="form-label">全称</label>
                            <input type="text" class="form-control" id="fullName" name="fullName"
                                   th:value="${fullName}" required>
                        </div>
                        <div class="mb-3">
                            <label for="username" class="form-label">用户姓名</label>
                            <input type="text" class="form-control" id="username" name="username"
                                   th:value="${username}" required>
                        </div>
                        <div class="mb-3">
                            <label for="email" class="form-label">邮箱</label>
                            <input type="email" class="form-control" id="email" name="email"
                                   th:value="${email}" required>
                        </div>
                        <div class="mb-3">
                            <label for="password" class="form-label">密码</label>
                            <input type="password" class="form-control" id="password" name="password" required>
                        </div>
                        <div class="d-grid">
                            <button type="submit" class="btn btn-primary">注册</button>
                        </div>
                    </form>

                    <div class="mt-3 text-center">
                        <p>你已经有账户了吗? <a th:href="@{/login}">从这里登录</a></p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
